#   SCE CONFIDENTIAL
#   PLAYSTATION(R)3 Programmer Tool Runtime Library 192.001
#   Copyright (C) 2006 Sony Computer Entertainment Inc.
#   All Rights Reserved.
#


#----------------------------------------------------------------------
# SPU
#----------------------------------------------------------------------

SPUGCC_DIR              ?= $(CELL_HOST_PATH)/spu/bin

SPU_PREFIX              = $(SPUGCC_DIR)/spu-lv2-
SPU_AR                  = $(SPU_PREFIX)ar
SPU_AS                  = $(SPU_PREFIX)as
SPU_CCAS                = $(SPU_PREFIX)gcc
SPU_CC                  = $(GCC_PREFIX) $(SPU_PREFIX)gcc
SPU_CXX                 = $(GCC_PREFIX) $(SPU_PREFIX)g++
SPU_LD                  = $(SPU_PREFIX)ld
SPU_CCLD                = $(SPU_PREFIX)gcc
SPU_CXXLD               = $(SPU_PREFIX)g++
SPU_NM                  = $(SPU_PREFIX)nm
SPU_OBJCOPY             = $(SPU_PREFIX)objcopy
SPU_OBJDUMP             = $(SPU_PREFIX)objdump
SPU_RANLIB              = $(SPU_PREFIX)ranlib
SPU_SIZE                = $(SPU_PREFIX)size
SPU_STRINGS             = $(SPU_PREFIX)strings
SPU_STRIP               = $(SPU_PREFIX)strip

SPU_DBG_FLAGS           ?= -g
SPU_OPTIMIZE_LV         ?= -O2
SPU_CSTDFLAGS           ?= $(CSTDFLAGS)
SPU_CXXSTDFLAGS         ?= $(CXXSTDFLAGS)
SPU_CWARNFLAGS          ?= $(CWARNFLAGS_L2) -Wno-main
SPU_CXXWARNFLAGS        ?= $(CXXWARNFLAGS_L2)
SPU_INCDIRS             ?=
SPU_CPPFLAGS            ?=
SPU_MACHINE_OPTION      ?=

SPU_TARGET_PATH         = $(CELL_TARGET_PATH)/spu
SPU_PSGL_LIBDIR         = $(SPU_TARGET_PATH)/lib/PSGL/$(CELL_GPU_TYPE)/$(CELL_PSGL_VERSION)

# for backward compatibility (obsoleted)
PSGL_SPU_LIBDIR         ?= $(SPU_PSGL_LIBDIR)

SPU_ASFLAGS             ?= $(ASFLAGS) $(SPU_INCDIRS) $(SPU_CPPFLAGS)
SPU_MDFLAGS             ?=
SPU_LDFLAGS             ?=
SPU_LOADLIBS            ?=
SPU_LDLIBS              ?=
SPU_LDLIBDIR            ?=
SPU_CFLAGS              ?= \
	$(SPU_DBG_FLAGS) \
	$(SPU_OPTIMIZE_LV) \
	$(SPU_CSTDFLAGS) \
	$(SPU_CWARNFLAGS) \
	$(SPU_INCDIRS) \
	$(SPU_CPPFLAGS) \
	$(SPU_MDFLAGS) \
	-DCELL_DATA_DIR=\"$(CELL_DATA_DIR)\"

SPU_CXXFLAGS            ?= \
	$(SPU_DBG_FLAGS) \
	$(SPU_OPTIMIZE_LV) \
	$(SPU_CXXSTDFLAGS) \
	$(SPU_CXXWARNFLAGS) \
	$(SPU_INCDIRS) \
	$(SPU_CPPFLAGS) \
	$(SPU_MDFLAGS) \
	-DCELL_DATA_DIR=\"$(CELL_DATA_DIR)\"

